<template>
  <div>
    <el-table :data="tableData"
              border
              style="width: 100%"
              height="500">
      <el-table-column prop="recipient"
                       label="接收者"
                       align="center">
      </el-table-column>
      <el-table-column prop="amount"
                       label="转账金额（税后）"
                       align="center">
      </el-table-column>
      <el-table-column prop="bankNumber"
                       label="银行卡号"
                       align="center">
      </el-table-column>
      <el-table-column prop="status"
                        label="状态"
                       align="center">
       
      </el-table-column>
      <el-table-column prop="explain"
                       label="说明"
                       align="center">
      </el-table-column>
      <el-table-column prop="originator"
                       label="发起人"
                       align="center">
      </el-table-column>
      <el-table-column prop="transferTime"
                       label="转账时间"
                       align="center">
      </el-table-column>
    </el-table>
    <el-row type="flex"
            align="middle"
            style="text-align: center">
      <el-col>
        <el-pagination @current-change="handleCurrentChange"
                       :current-page.sync="pageNum"
                       :page-size="pageSize"
                       layout="total, prev, pager, next"
                       :total="total">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      pageNum: 1,
      pageSize: 5,
      total: 0,
      tableData: [],
      // 初始化分页参数
      pageparm: {
        currentPage: 1,
        pageSize: 5,
        total: 0,
      },
    }
  },
  mounted () {
    this.$axios.get("/finance/transfer/findAll").then(res => {
      if (res.data.code == 200) {
        this.tableData = res.data.data;
        
      }
    })
  },
  methods: {
    getsuccess(){
        this.$axios.get("/finance/transfer/findAll")
        .then((res) => {
            if(res.data.code == 200){
                this.tableData = res.data.data;
                this.pageparm.total = res.data.data.total;
            }else{
                this.$message({type: 'info',message: res.data.message})
            }
        })
        .catch(err => {
            this.$message.error('数据加载失败，请稍后再试！')
        })
    },
    // 分页插件事件
    callFather(parm) {
      this.pageparm.currentPage = parm.currentPage;
      this.pageparm.pageSize = parm.pageSize;
      this.getdata();
    },
    // uploadTable () {
    //   this.$axios.get("/finance/transfer/findAll").then(res => {
    //     if (res.data.code == 200) {
    //       this.tableData = res.data.data.data
          
    //     }
    //   })
    // }
  }
}
</script>

<style scoped>
</style>
